#include<iostream>
#include <cstring>
#include <stdlib.h>
void add(char *a, int la, char* b, int lb, char *val)
{
    int pa=la-1,pb=lb-1;
    char *an,*bn;
    int pv;
    if(la>lb){
        an=a;bn=b;
        pv=la;
    }else{
        an=b;bn=a;
        pv=lb;
        pa = lb-1;pb=la-1;
    }
    int c = 0;
    while(pa>=0||pb>=0)
    {
        char ca,cb;
        ca=pa>=0?an[pa--]:'0';
        cb=pb>=0?bn[pb--]:'0';
        int tv=ca+cb-'0'-'0'+c;
        c=tv/10;
        tv%=10;
        val[pv--]=tv+'0';
    }
    val[pv]=c+'0';

}
int main(int argc, char *argv[])
{
    char a[1000]={0},b[1000]={0};
    int n;
    std::cin>>n;
    for(int i = 1; i<=n; i++)
    {
        char v[1001]={0};
        std::cin>>a>>b;
        add(a, strlen(a), b, strlen(b), v);
        int lv = strlen(v);
        for(int j = 0; j < lv; j++)
        {
            if(v[j]!='0')
            {
                std::cout<<"Case "<<i<<":\n"<<a<<" + "<<b<<" = "<<v+j<<std::endl;
                if(i!=n)
                    std::cout<<std::endl;
                break;
            }
        }
    }
}
